package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.higgins.eventtracking.client.dto.HealthEventDTO;

@PersistenceCapable
public class HealthEvent {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Date timestamp;
	
	@Persistent
	private String healthEventType;
	
	@Persistent
	private String healthEventIntensity;
	
	@Persistent
	private Integer healthEventIntensityScale;

	@Persistent
	private String healthEventFrameOfMind;
	
	@Persistent
	private String startEnd;
	
	@Persistent
	private String description;

	public HealthEvent(HealthEventDTO dto)	{
		this.timestamp = dto.getTimestamp();
		this.healthEventType = dto.getHealthEventType();
		this.healthEventIntensity = dto.getHealthEventIntensity();
		this.healthEventIntensityScale = dto.getHealthEventIntensityScale();
		this.healthEventFrameOfMind = dto.getHealthEventFrameOfMind();
		this.description = dto.getDescription();
		this.startEnd = dto.getStartEnd();
	}
	public HealthEvent()	{
		
	}
	
	public String toString()	{
		return healthEventType + "(" + healthEventIntensity + ")";
	}
	public void setTimestamp(Date timestamp)	{
		this.timestamp = timestamp;
	}
	public Date getTimestamp()	{
		return timestamp;
	}
	public void setHealthEventType(String healthEventType)	{
		this.healthEventType = healthEventType;
	}
	public String getHealthEventType()	{
		return healthEventType;
	}
	public void setHealthEventIntensity(String healthEventIntensity)	{
		this.healthEventIntensity = healthEventIntensity;
	}
	public String getHealthEventIntensity()	{
		return healthEventIntensity;
	}
	public void setHealthEventIntensityScale(Integer healthEventIntensityScale)	{
		this.healthEventIntensityScale = healthEventIntensityScale;
	}
	public Integer getHealthEventIntensityScale()	{
		return healthEventIntensityScale;
	}
	public void setHealthEventFrameOfMind(String healthEventFrameOfMind)	{
		this.healthEventFrameOfMind = healthEventFrameOfMind;
	}
	public String getHealthEventFrameOfMind()	{
		return healthEventFrameOfMind;
	}
	public void setDescription(String description)	{
		this.description = description;
	}
	public String getDescription()	{
		return description;
	}	
	public void setStartEnd(String startEnd)	{
		this.startEnd = startEnd;
	}
	public String getStartEnd()	{
		return startEnd;
	}
	public HealthEventDTO toDTO() {
		HealthEventDTO dto = new HealthEventDTO(timestamp, healthEventType, healthEventIntensity, healthEventIntensityScale, healthEventFrameOfMind, description, startEnd);		
		return dto;
	}

}
